package com.MovieManageSystem.service.implement;

import com.MovieManageSystem.domain.Collection;
import com.MovieManageSystem.mapper.CollectionMapper;
import com.MovieManageSystem.service.CollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class CollectionServiceImpl implements CollectionService {
    @Autowired
    private CollectionMapper collectionMapper;
    @Override
    public List<Collection> getCollectList(Collection collection) {
        return collectionMapper.getCollectList(collection);
    }

    @Override
    public void insertCollection(Collection collection) {
        collection.setCollectTime(LocalDateTime.now());
        collectionMapper.insertCollection(collection);
    }

    @Override
    public void deleteCollectionByCid(Long cid) {
        collectionMapper.deleteCollectionByCid(cid);
    }



}
